'''
Description: 
version: 1.0.0
Author: peng2.zhang
Date: 2021-11-24 15:53:24
LastEditors: peng2.zhang
LastEditTime: 2022-02-10 15:55:07
'''
# coding: utf-8
from ci_conclude.models.db import DBase
from sqlalchemy import Column, Date, DateTime, Index, String, Text, text
from sqlalchemy.dialects.mysql import INTEGER, TINYINT
from sqlalchemy.ext.declarative import declarative_base

Base = declarative_base()
metadata = Base.metadata

class JenkinsBuildHistory(Base, DBase):
    __tablename__ = 'jenkins_build_history'

    id = Column(INTEGER(11), primary_key=True)
    job_name = Column(String(255), nullable=False, index=True, server_default=text("''"), comment='job名称')
    build_id = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='job构建编号')
    build_version = Column(String(255), nullable=False, server_default=text("''"), comment='构建版本号')
    job_status = Column(String(255), nullable=False, server_default=text("''"), comment='构建状态')
    job_duration = Column(String(255), nullable=False, server_default=text("''"), comment='构建状态')
    job_retry_times = Column(INTEGER(2), nullable=False, server_default=text("'0'"), comment='job重试次数')
    server_name = Column(String(255), nullable=False, server_default=text("''"), comment='微服务名称')
    server_id = Column(String(255), nullable=False, server_default=text("''"), comment='微服务名称')
    language_type = Column(INTEGER(11), nullable=False, server_default=text("'1'"), comment='语言类型1:java, 2:python, 3:cxx')
    sonar_bugs = Column(INTEGER(11), nullable=False, server_default=text("'-1'"), comment='sonar代码扫描结果-bugs数')
    sonar_new_bugs = Column(INTEGER(11), nullable=False, server_default=text("'-1'"), comment='sonar代码扫描结果-new_bugs数')
    sonar_blocker = Column(INTEGER(11), nullable=False, server_default=text("'-1'"), comment='sonar代码扫描结果-blocker数')
    sonar_critical = Column(INTEGER(11), nullable=False, server_default=text("'-1'"), comment='sonar代码扫描结果-critical数')
    sonar_major = Column(INTEGER(11), nullable=False, server_default=text("'-1'"), comment='sonar代码扫描结果-major数')
    sonar_minor = Column(INTEGER(11), nullable=False, server_default=text("'-1'"), comment='sonar代码扫描结果-minor数')
    sonar_code_smell = Column(INTEGER(11), nullable=False, server_default=text("'-1'"))
    sonar_vulnerability = Column(INTEGER(11), nullable=False, server_default=text("'-1'"))
    sonar_status = Column(String(32), nullable=False, server_default=text("''"), comment='sonar代码扫描结果-status')
    junit_tests = Column(INTEGER(11), nullable=False, server_default=text("'-1'"), comment='junit单测结果-tests数')
    junit_failures = Column(INTEGER(11), nullable=False, server_default=text("'-1'"), comment='junit单测结果-failures数')
    junit_skipped = Column(INTEGER(11), nullable=False, server_default=text("'-1'"), comment='junit单测结果-skipped数')
    cov_java_line_nums = Column(INTEGER(11), nullable=False, server_default=text("'-1'"), comment='代码覆盖率结果-line_nums数')
    cov_java_line_coverage = Column(INTEGER(11), nullable=False, server_default=text("'-1'"), comment='代码覆盖率结果-line_coverage数')
    cov_java_method_nums = Column(INTEGER(11), nullable=False, server_default=text("'-1'"), comment='代码覆盖率结果-method_nums数')
    cov_java_method_coverage = Column(INTEGER(11), nullable=False, server_default=text("'-1'"), comment='代码覆盖率结果-method_coverage数')
    cov_java_class_nums = Column(INTEGER(11), nullable=False, server_default=text("'-1'"), comment='代码覆盖率结果-class_nums数')
    cov_java_class_coverage = Column(INTEGER(11), nullable=False, server_default=text("'-1'"), comment='代码覆盖率结果-class_coverage数')
    cov_java_package_nums = Column(INTEGER(11), nullable=False, server_default=text("'-1'"), comment='代码覆盖率结果-package_nums数')
    cov_py_file_nums = Column(INTEGER(11), nullable=False, server_default=text("'-1'"), comment='代码覆盖率结果-file_nums数')
    cov_py_covered_file_num = Column(INTEGER(11), nullable=False, server_default=text("'-1'"), comment='代码覆盖率结果-covered_file_num数')
    cov_py_total_lines = Column(INTEGER(11), nullable=False, server_default=text("'-1'"), comment='代码覆盖率结果-total_lines数')
    cov_py_covered_lines = Column(INTEGER(11), nullable=False, server_default=text("'-1'"), comment='代码覆盖率结果-covered_lines数')
    cov_py_coveraged = Column(INTEGER(11), nullable=False, server_default=text("'-1'"), comment='代码覆盖率结果-coveraged数')
    cov_py_total_coverage = Column(INTEGER(11), nullable=False, server_default=text("'-1'"), comment='代码覆盖率结果-total_coverage数')
    cov_py_packages_covered = Column(INTEGER(11), nullable=False, server_default=text("'-1'"), comment='代码覆盖率结果-packages_covered数')
    allure_total = Column(INTEGER(11), nullable=False, server_default=text("'-1'"), comment='allure结果-total数')
    allure_failed = Column(INTEGER(11), nullable=False, server_default=text("'-1'"), comment='allure结果-failed数')
    allure_error = Column(INTEGER(11), nullable=False, server_default=text("'-1'"), comment='allure结果-error数')
    allure_passed = Column(INTEGER(11), nullable=False, server_default=text("'-1'"), comment='allure结果-passed数')
    allure_skipped = Column(INTEGER(11), nullable=False, server_default=text("'-1'"), comment='allure结果-skipped数')
    allure_broken = Column(INTEGER(11), nullable=False, server_default=text("'-1'"), comment='allure结果-broken数')
    allure_pass_rate = Column(INTEGER(11), nullable=False, server_default=text("'-1'"), comment='allure结果-pass_rate数')
    allure_exec_rate = Column(INTEGER(11), nullable=False, server_default=text("'-1'"), comment='allure结果-exec_rate数')
    git_commit_branch = Column(String(255), nullable=False, server_default=text("''"), comment='git构建分支名称')
    git_commit_time = Column(DateTime, nullable=False, server_default=text("CURRENT_TIMESTAMP"), comment='git提交时间')
    git_commit_by = Column(String(255), nullable=False, server_default=text("''"), comment='git提交者')
    git_commit_id = Column(String(255), nullable=False, server_default=text("''"), comment='git提交者')
    eureka_version = Column(String(255), nullable=False, server_default=text("''"), comment='eureka_version')
    eureka_status = Column(String(255), nullable=False, server_default=text("''"), comment='eureka_status')
    eureka_update_time = Column(DateTime, server_default=text("CURRENT_TIMESTAMP"), comment='eureka_update_time')
    create_time = Column(DateTime, nullable=False, server_default=text("CURRENT_TIMESTAMP"), comment='信息创建时间')
    update_time = Column(DateTime, nullable=False, server_default=text("CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"), comment='信息更新时间')


class WxUser(Base, DBase):
    __tablename__ = 'wx_user'

    id = Column(INTEGER(11), primary_key=True)
    username = Column(String(255), nullable=False, unique=True, server_default=text("''"), comment='wx用户名')
    mobile = Column(String(15), nullable=False, server_default=text("'0'"), comment='mobile')
    create_time = Column(DateTime, nullable=False, server_default=text("CURRENT_TIMESTAMP"), comment='信息创建时间')
    update_time = Column(DateTime, nullable=False, server_default=text("CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"), comment='信息更新时间')


class SonarStatistic(Base, DBase):
    __tablename__ = 'sonar_statistics'

    id = Column(INTEGER(11), primary_key=True)
    sindex = Column(String(255), nullable=False, index=True, server_default=text("''"), comment='统计指标')
    sdate = Column(Date, nullable=False, comment='统计时间')
    sindex_desc = Column(String(255), nullable=False, server_default=text("''"), comment='统计指标说明')
    sindex_desc_cn = Column(String(255), nullable=False, server_default=text("''"), comment='统计指标说明')
    admapci_ad_compare_diff_app_meta = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='admapci_ad_compare_diff_app_meta')
    admapci_ad_daa_slam_artificial_service_app_meta = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='admapci_ad_daa_slam_artificial_service_app_meta')
    admapci_ad_imp_upload_web_app_meta = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='admapci_ad_imp_upload_web_app_meta')
    admapci_ad_daa_detection_service_app_meta = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='admapci_ad_daa_detection_service_app_meta')
    admapci_ad_editor_web_app_meta = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='admapci_ad_editor_web_app_meta')
    admapci_ad_slam_artificial_web_app_meta = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='admapci_ad_slam_artificial_web_app_meta')
    admapci_ad_daa_segment_service_app_meta = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='admapci_ad_daa_segment_service_app_meta')
    admapci_ad_daa_dynamic_removal_app_meta = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='admapci_ad_daa_dynamic_removal_app_meta')
    admapci_ad_daa_multislam_optimization_app_meta = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='admapci_ad_daa_multislam_optimization_app_meta')
    admapci_ad_daa_road_section_app_meta = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='admapci_ad_daa_road_section_app_meta')
    admapci_ad_imp_check_material_app_meta = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='admapci_ad_imp_check_material_app_meta')
    admapci_ad_imp_check_addata_app_meta = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='admapci_ad_imp_check_addata_app_meta')
    admapci_ad_imp_task_web_app_meta = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='admapci_ad_imp_task_web_app_meta')
    admapci_ad_ground_concate_app_meta = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='admapci_ad_ground_concate_app_meta')
    admapci_ad_imp_upload_service_app_meta = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='admapci_ad_imp_upload_service_app_meta')
    admapci_ad_img_det_app_meta = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='admapci_ad_img_det_app_meta')
    admapci_ad_imp_check_platform_app_meta = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='admapci_ad_imp_check_platform_app_meta')
    admapci_ad_imp_check_workflow_app_meta = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='admapci_ad_imp_check_workflow_app_meta')
    admapci_ad_imp_build_service_app_meta = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='admapci_ad_imp_build_service_app_meta')
    admapci_ad_pc_seg_app_meta = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='admapci_ad_pc_seg_app_meta')
    admapci_ad_imp_public_service_app_meta = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='admapci_ad_imp_public_service_app_meta')
    admapci_ad_slam_alignment_app_meta = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='admapci_ad_slam_alignment_app_meta')
    admapci_ad_signage_app_meta = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='admapci_ad_signage_app_meta')
    admapci_daa_pcpro_service_app_meta = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='admapci_daa_pcpro_service_app_meta')
    admapci_ad_daa_basicdata_query_service_app_meta = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='admapci_ad_daa_basicdata_query_service_app_meta')
    admapci_ad_daa_multi_slam_app_meta = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='admapci_ad_daa_multi_slam_app_meta')
    admapci_ad_daa_extract_using_service_app_meta = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='admapci_ad_daa_extract_using_service_app_meta')
    admapci_ad_daa_single_slam_app_meta = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='admapci_ad_daa_single_slam_app_meta')
    admapci_ad_daa_standardization_app_meta = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='admapci_ad_daa_standardization_app_meta')
    admapci_ad_imp_autolink_app_meta = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='admapci_ad_imp_autolink_app_meta')
    admapci_ad_imp_edit_services_app_meta = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='admapci_ad_imp_edit_services_app_meta')
    admapci_ad_img_seg_services_app_meta = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='admapci_ad_img_seg_services_app_meta')
    admapci_ad_imp_mbuild_server_app_meta = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='admapci_ad_imp_mbuild_server_app_meta')
    admapci_ad_imp_mergeinto_service_app_meta = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='admapci_ad_imp_mergeinto_service_app_meta')
    admapci_ad_imp_matchdiff_app_meta = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='admapci_ad_imp_matchdiff_app_meta')
    admapci_ad_imp_postprocess_service_app_meta = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='admapci_ad_imp_postprocess_service_app_meta')
    admapci_daa_upground_service_app_meta = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='admapci_daa_upground_service_app_meta')
    admapci_daa_ground_service_app_meta = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='admapci_daa_ground_service_app_meta')
    admapci_ad_pc_det_app_meta = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='admapci_ad_pc_det_app_meta')
    admapci_ad_imp_tasksplit_interface_app_meta = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='admapci_ad_imp_tasksplit_interface_app_meta')
    admapci_ad_imp_process_store_app_meta = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='admapci_ad_imp_process_store_app_meta')
    admapci_ad_imp_problemdb_app_meta = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='admapci_ad_imp_problemdb_app_meta')
    admapci_ad_imp_querydb_new_app_meta = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='admapci_ad_imp_querydb_new_app_meta')
    admapci_ad_imp_prepare_interface_manbuild_app_meta = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='admapci_ad_imp_prepare_interface_manbuild_app_meta')
    admapci_ad_imp_prepare_interface_recognition_app_meta = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='admapci_ad_imp_prepare_interface_recognition_app_meta')
    admapci_ad_imp_daa_extract_service_app_meta = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='admapci_ad_imp_daa_extract_service_app_meta')
    admapci_ad_imp_task_service_app_meta = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='admapci_ad_imp_task_service_app_meta')
    admapci_daa_automultiple_service_app_meta = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='admapci_daa_automultiple_service_app_meta')
    admapci_admapci_imp_config = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='admapci_admapci_imp_config')
    admapci_admapci_imp_gateway = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='admapci_admapci_imp_gateway')
    admapci_admapci_imp_message = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='admapci_admapci_imp_message')
    admapci_admapci_imp_registe = Column(INTEGER(11), nullable=False, server_default=text("'0'"), comment='admapci_admapci_imp_registe')
    create_time = Column(DateTime, nullable=False, server_default=text("CURRENT_TIMESTAMP"), comment='信息创建时间')
    update_time = Column(DateTime, nullable=False, server_default=text("CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"), comment='信息更新时间')
